#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <stdio.h>

/*	test
  */
int main(int argc, char ** argv)
{
	int fd;
	int num;
	unsigned char key_vals[4];
	
	fd = open("/dev/button",O_RDWR);
	if (fd < 0)
	{
		printf("can't open !\n");
	}

	while(1)
	{
		read(fd, key_vals, sizeof(key_vals));
		if(!key_vals[0] || !key_vals[1] || !key_vals[2] || !key_vals[3] )
		{
			printf("%04d key pressed: %d %d %d %d\n",num++,key_vals[0],key_vals[1],key_vals[2],key_vals[3]);
		}

	}
}

